<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\service\ThirdService;

class Third extends Api
{

    // 无需登录的接口,*表示全部
    protected $noNeedLogin = ['openid','login','mobile'];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];

    // 微信一键登录
    public function openid()
    {
        $data = $this->request->post();
        $res = ThirdService::getOpenid($data);
        return json($res);
    }

    // 手机号登录账户绑定微信
    public function bind()
    {
        $data = $this->request->post();
        $res = ThirdService::bindWechat($data);
        return json($res);
    }

    // 手机号登录账户保存openid
    public function save()
    {
        $data = $this->request->post();
        $res = ThirdService::saveOpenid($data);
        return json($res);
    }





}
